package com.project.mapper;

import com.github.pagehelper.PageInfo;
import com.project.bean.StudentBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface IStudentMapper {
    @Select("select * from t_student")
    @ResultMap("studentMap")
    public List<StudentBean> findAll();

    @Insert("insert into t_student(s_name,s_birthday,s_grade) values(#{name},#{birthday},#{grade})")
    public void addStudent(StudentBean student);

    @Delete("delete from t_student where pk_id = #{id}")
    public void del(int id);

    @Update("update t_student set s_grade = #{grade} where pk_id = #{id}")
    public void update(@Param("id") int id,@Param("grade") int grade);

    @Select("select * from t_student where pk_id = #{id}")
    @ResultMap("studentMap")
    public StudentBean findById(int id);

}
